package parsing.productions;

/**
 * An interface representing a node in the abstract syntax tree of a program.
 */
public interface Node {

	/**
	 * The number of nodes in this AST, including the current node.
	 * This counts all productions but no terminal symbols.
	 */
	int size();

	/**
	 * Appends the program represented by this node prettily to
	 * the given StringBuffer.
	 * @param sb The StringBuffer to be appended
	 */
	void prettyPrint(StringBuffer sb);
	
	/**
	 * Makes a copy of this Node and this Node's tree.
	 * @return the copy of this Tree.
	 */
	Node duplicate();

	/**
	 * Checks if this node's AST is the same as n's 
	 * @param n the node to check against
	 * @return true if this node is the same as n
	 */
	boolean equals(Node n);
}
